package com.tedu._04mybatis.mapper;

import com.tedu._04mybatis.pojo.User;
import com.tedu._04mybatis.pojo.Weibo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    /*
     @Insert("INSERT INTO user(username,password,nickname,created) " +
            "VALUES (#{username},#{password},#{nickname},#{created}) ")
     */


    int insert(User user);

    /*
    @Delete("DELETE FROM user " +
            "WHERE id=#{id}")
     */

    int deleteUserById(Integer id);

    /*
    @Update("UPDATE user "+
            "SET username=#{username},password=#{password},nickname=#{nickname},created=#{created} "+
            "WHERE id=#{id}")
     */

    int updateUser(User user);

    /*
    @Select("SELECT id,username,password,nickname,created " +
            "FROM user " +
            "WHERE id=#{id} ")
     */

    User selectUserById(Integer id);

    /*
     @Select("SELECT id,username,password,nickname,created " +
            "FROM user")
     */

    List<User> selectAllUsers();
}
